<template>
  <div class="container">
    <!-- 导入全局组件面包屑 -->
    <XtxBread>
      <!-- 导入全局组件一级分类 -->
      <XtxBreadItem :to="`/category/${subCategoryData.parentId}`">
      {{subCategoryData.parentName}}
      </XtxBreadItem>
       <!-- 导入全局组件二级分类 -->
    <XtxBreadItem>{{ subCategoryData.name }}</XtxBreadItem>
    </XtxBread>
  </div>
</template>
<script>
// 导入vue函数
import { inject } from 'vue'
export default {
  setup () {
    // 接受父组件 provide 二级分类名字数据
    const subCategoryData = inject('subCateData')
    console.log(subCategoryData)

    return { subCategoryData }
  }
}
</script>
<style scoped lang="scss"></style>
